\f0\b0\i0\outl0\shad0\fs20 \cf0 \expan0 \ul0 \u160 \f1\b0\i0\outl0\shad0\fs18 \cf1 \expan0 \ul0 \line \line \line \line \line \line \f2\b0\i0\outl0\shad0\fs48 \cf1 \expan0 \ul0 Cryptography\f1\b0\i0\outl0\shad0\fs18 \cf1 \expan0 \ul0 \line \line Written By A.Forster of [ACI] Database\line \line Table of Contents\line ~~~~~~~~~~~~~~~~~\line o 1 - Introduction\line o 2 - Crypto-Misconceptions\line o 3 - What makes an algorithm insecure?\line o 4 - What Makes a Strong Cryptographic Algorithm?\line o 5 - Overview of modern cryptographic systems\line \line \line Introduction\line ~~~~~~~~~~~~\line I just finished reading a book the other night. The author, Dr. David Brin raised the question that, if the future society truly wants freedom, privacy can only be counter-productive. Brin suggests that regardless of how much society gravitates toward encryption and secrecy, there will always be a class of people who will be able to manipulate and overcome the common citizen\u8217's attempts at privacy. This class of people include governments, terrorists, and the technologically elite class, otherwise called hackers. The author suggests that that society should move toward openness rather than secrecy. It is the only way that people can be held accountable for their actions. The only problem with Brin\u8217's proposal is that people will never agree that an open society is the answer. Americans hold their right to keep secrets and protect themselves with encryption and concealment to be fundamental, they will not likely allow it to be taken away from them. While I agree that Brin\u8217's ideas are very well founded and were conceived with the best of intentions, I don\u8217't think that they will become reality within my lifetime or the following few generations.\line \line As a result of my opinion I\u8217've taken a fair amount of interest in the field of cryptography. My reasoning is that I may as well familiarize myself with something that will be in use all over the world by the time I\u8217'm thirty years old. I\u8217've spent quite a few hours sifting through the net in search of information on cryptography, and, while I\u8217've found much that\u8217's been of use to me, there is a majority of information on the net and in books that is completely useless. The same is true for encryption/decryption applications. There are some programs that will give your information a great deal of security, while other applications, which may seem secure, in fact provide little to no protection at all against anyone familiar with modern cryptography. The goal of this paper is to provide the highly esteemed Happle reader with a comprehensive overview of modern cryptography as well as what makes cryptographic algorithms secure or insecure.\line \line \line Cryptographic Misconceptions\line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\line After having gone through most of the Freeware and Shareware cryptography application available to the general public, I\u8217've got a decent understanding of what mistakes people are making when writing cryptography software. The most common of developer blunder is to assume that if your result after encrypting looks absolutely nothing like the original text, your program can secure data. I\u8217've had people tell me that their algorithm is amazing because their math teacher couldn\u8217't figure out what the cipher text was before it was encrypted. It doesn\u8217't matter how well your math teacher knows their multiplication tables people, their crypt analysis skills are nothing compared to a half-decent cipherPunk and their old ThinkC compiler. The first thing you have to ask yourself is this: \u8220"If I gave someone all the source code for my encryption program, would it still be nearly impossible for them to crack in less than a year?\u8221" If you can\u8217't give out your crypto-source code because it might compromise the security of your program, then it was never secure in the first place. Modern ciphers don\u8217't hide what they\u8217're doing for people. The ciphers being developed in this decade rely on making themselves impractical to compromise. The algorithms are based on keys and passphrases while using standard manipulation methods. The result is encrypted data which has a number of possible origins that is directly proportional to the size of the key used (the \u8216'keyspace\u8217') or the length and discretionary nature of the passphrase that the user has chosen. I realize I may be losing you due to the completely bland nature this paragraph has adopted so I\u8217'll give you a few visual examples.\line \line ex1.\line An example of a very poor algorithm is one that doesn\u8217't change the method of encryption depending on a user entered passphrase or keyspace.\line \line Suppose an algorithm is handed a text with the following string: \u8216'Bushido Cyberspace\u8217' The algorithm takes each letter and adds \u8216'5\u8217' to the ascii value of the original letter. (By the way, Bushido IS a word.) The result is as follows: \u8216'Gzxmnit Hdgjwxufhj\u8217' Certainly, at first glance, the result is unreadable, it\u8217's even conceivable that many people would be unable to determine the original text given the resulting cipher text. Now suppose the algorithm exchanges the placing of the two words and reverses everything except the capital letters. The result would be: \line \u8216'Hjhfuxwjgd Gtinmxz\u8217' now if someone were to try only an alphabetic shift approach to determining the original text, they would not get the correct result. They would get the correct letters, but not the correct positioning. Now for the final assumption in this example. Let\u8217's assume that you tell your math teacher: \u8220"I shifted the ascii values and I also shifted the position of \u8216'some\u8217' of the letters\u8221" Well if you had a half decent math teacher then he or she would likely smack you in the head. It would simply take them too long to sit down and try all of the possible combinations (there are far more than 10,000 possibilities.) If we assume that your math teacher can work out 5 solutions every ten minutes, it would still take him or her over 14 days to find an answer. That\u8217's not including time for eating, sleeping, or hanging out on Hotline. So most people stop at this point. They say to themselves, or to an admin on [ACI] \u8220"Hey, my math teacher can\u8217't figure it out, so it\u8217's secure.\u8221" \line Well, not quite kid. I have to get back to the cipherPunk and their C compiler. If you tell a cPunk what you told your teacher about the algorithm, it might take them an hour and a half to write a program to crack your algorithm, and the computer would do the rest of the work in about 5 minutes. Then, once they find out exactly how your algorithm works (how you reposition the letters) they can write another program in five minutes to crack anything you encrypt in under 10 seconds. Then they can distribute the program and the weeks of work that you poured into your \u8216'secure\u8217' algorithm just serve as a reminder that you\u8217're not very good at coding secure algorithms. But that won\u8217't happen now that you\u8217've read this paper.\line \line \line What makes an algorithm insecure?\line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\line First of all, I\u8217'm not sure what kind of reader you are, so let me step back an inch or so and explain what I\u8217'm talking about here. A cipher is generally thought of as a self contained set of code which, when put to use, can encrypt and decrypt information. Ciphers depend on mathematical algorithms, which are sections of code that manipulate the data. Algorithms are usually long, drawn out, mathematical sets which can take the phrase \u8220"Hello world!\u8221" and turn it into a 35 character set of random numbers and letters. It\u8217's usually accompanied by a sister-algorithm that reverses the process. Ok, well now that algorithms have been defined, let\u8217's explore what makes certain algorithms useless. As you saw in the last section, an algorithm is insecure if it was designed to elude people. Hiding things in your socks eludes most people; so if your algorithm is over their heads don\u8217't be too impressed with yourself. You have to realize that you\u8217're up against a computer, a smart crypto-elite programmer, and possibly a few of his friends\u8217' processors. The average modern computer can chug through your algorithm, processing thousands of possible outcomes and original texts every second. If the algorithm is based mainly on methods of moving the text around, then you probably won\u8217't get much more than 10-20 million possibilities. A single modern computer can crack an algorithm like that in about an hour and a half. (Though that might be giving the algorithm a bit too much credit.) There are other algorithms that do base their methods of encryption on passphrases and keys. If there is a single flaw in the design of the algorithm\u8217's security, the cipher can likely be compromised before it\u8217's a week old. Let me show you an example of an advisory I wrote for a terribly insecure cipher released not too long ago.\line \line \line [advanced computing information database]\line \line Advisory for:\line mSec Crypt() (no version number specified in the application)\line \line /************************************************************************/\line One of the tests\line /************************************************************************/\line \line I encrypted approximately 10 different plaintexts 3 times each with varying passwords and varying program settings. The test which shows the flaws most apparently is below.\line \line \line The plaintext I encrypted is as follows:\line \line abcdefghijklmnopqrstuvwxyz\line 1234567890\line \line \line When encrypted with the most secure key that the program offers the result is as follows:\line \line -- Begin mSec Private Key Encrypt --\line \line KJIHGFEDCBA@?>=<;:987654321{zyxwvuts\line \line -- End mSec Private Key Encrypt ---\line \line \line Alright, so in this case I just ran a string of sequential characters through the cipher on it\u8217's most \u8216'secure\u8221" setting and, as soon as I saw the result, I knew what sort of algorithm was used to encrypt the text. The original text is just reversed and the ASCII value is shifted over according to the value of the passphrase entered. The problem with this is that there are less than 256 possibilities for the ascii shift. Regardless of how long it might take a person to calculate all of the possibilities, a computer program can take all of these possibilities in a fraction of a second.\line \line \line What Makes a Strong Cryptographic Algorithm?\line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\line Since I\u8217've given some explanation on what makes an algorithm insecure, I\u8217'll move on to the features and characteristics of a potentially secure cipher. While I might have been a bit hard on the importance of a cipher\u8217's potential entropy in the last chapter, we must all be aware that it is, of course, the basis of encryption technology to make the data impossible to read by humans. What strong algorithms take into account is that they now have to make the data impossible to be read by some of the new computer processors as well. So the modern algorithms perform enough of a pass-phrase modification to make the result almost entirely different from the original. There are a few standard methods of getting this done, I\u8217'll outline the most used below.\line \line o Permutation\line \line Suppose a message is as follows: \u8220"Neural_Arcology\u8221" A permutation separates an original text into sections of approximately 5-10 characters and then changes the position of a number of letters. If we performed a permutation on the above phrase using blocks of 5 characters then the result might be as follows: \u8220"aureNcAr_lyoglo\u8221" The developers would refer to this as a 5_53421 permutation. The string of 5 digits referring to the positions of the original characters after the permutation.\line \line o Blocking\line \line Suppose a message is as follows: \u8220"vacant panda motel\u8221" Blocking involves designating sections of the original text to numbered blocks, after which, each block has its position rearranged by the algorithm. Blocking the above phrase into sections of three characters and rearranging it gives the following result: \u8220"ndavac patlant mo\u8221"\line \line o Substitution & Shift operations\line \line Substitution operations simply substitute a specified set of characters for the original characters which are to be encrypted. The phrase \u8220"Dave, are you there?\u8221" might become \line \u8220"hrksl res wiv m,seso\u8221"\line \line Many people use these functions in conjunction with a passphrase and consider the entire application to be secure. Well, these people still have a lot to learn. If you want to code a fairly secure cipher then you\u8217'll need to use (most likely) all of these functions, as well as other similar functions. You\u8217'll need to use them more than once each time you encrypt, and layer them so that the result of the encryption is completely different both in size, character sets, and location of charcters. It is also important that as many functions as possible rely on a user-entered passphrase to get the work done. \line \line The manner in which the passphrase influences the various functions is of vital importance. A good cipher will make sure that a message encrypted with the passphrasem \u8220"hello\u8221" is very different from a message that is encrypted with \u8220"hellp\u8221" (\u8216'p\u8217' being one letter after \u8216'o\u8217' in the alphabet =) How does an algorithm accomplish this in an effective manner? Usually it expands the passphrase to a much larger size. A good passphrase algorithm can take the word \u8220"DataNaga\u8221" and expand it to a 2000 character set of random characters. The algorithm can then substitute according to the expanded passphrase with much more effectiveness.\line \line \line Overview of Modern Cryptographic Systems\line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\line There are a few generally accepted standard forms of cryptography. These are standard forms of encrypting/decrypting and communicating over private channels. The two largest such forms of cryptographic systems are -Symmetric Key algorithms- and -Public Key algorithms-\line \line o Symmetric Key Cryptography\line \line This form of encryption sets up a model in which a key is used to encrypt data. The party that wishes to decrypt that data must use the original key, the one that was used to encrypt, in order to return the ciphertext into the original legible data. So suppose we have two people, Bob and Alice, and they would like to use encryption to hide evidence of their affair. Bob and Alice meet in a Starbuck\u8217's coffee and, on their TI85 calculator, come up with a big page-long key that they can use to encrypt materials later on. They go back to their homes and Bob encrypts his love letter using the agreed upon key. He transmits the encrypted data over the internet and Alice eventually decrypts the letter using the same key. There is a flaw in this protocol however. Let\u8217's suppose that Susan, Bob\u8217's legal wife, knows a bit about computers as well. Susan could take Bob\u8217's key from his computer, or she could bribe the kid at Starbucks for the security camera\u8217's tape which clearly shows the key that Bob and Alice worked on. Now Susan can read everything that Bob sends Alice, as well as everything that Alice sends Bob. (Never mind that she could just use the tape of them in a Starbucks as proof of the affair, this is a paper on cryptography.)\line \line o Public Key Cryptography\line \line This is the form of encryption that both governments and the technologically elite have accepted as the standard in ultimate cryptographic security. Let me explain the protocol to you. This time Bob has learned from his earlier mistake. (Not the cheating part, but using a symmetric algorithm) So he and his new lover, Denise, use a public key cryptographic algorithm to keep their affair secret. Bob and Denise both download a copy of PGP and when they start the program it creates a pair of keys for both of them. One of the keys is known as a Public Key and the other is a Private Key. Later that evening, Bob encrypts some more love letters to Denise using her public key. What it\u8217's important to realize at this point is that a message encrypted with Denise\u8217's public key can only be decrypted with her private key. Denise keeps her private key stored in a safe place and she\u8217's the only person who needs to know its location. So she receives Bob\u8217's letters and uses her private key to decrypt them. She writes a reply and encrypts it with Bob\u8217's public key (public keys are freely available and can be given to anyone. No message can be decrypted with a public key) And Bob decrypts the message with his private key. And the process repeats. There is no room in this protocol to allow for Susan, the jealous wife, to find out what they\u8217're saying to each other, because each time they decrypt messages with a private key, they also need to enter a passphrase (approximately 4 or 5 words) in order for the private key to work. Since Bob and Denise both store their passphrases in their heads like good little computer users should, there is no way (short of installing home video cams) for Susan to interrupt Bob\u8217's adulterous habits. Things to keep in mind: Public key cryptography uses keys with enough complexity to allow for 2^64 possible keys. That\u8217's a number with over 60 digits for the people that don\u8217't know what exponents are.\line \line \line Brief Conclusion\line ~~~~~~~~~~~~~~~~\line I sympathize with David Brin\u8217's concern for a society shrouded in secrecy, but I cannot escape reality, and therefore, the fact that privacy is the inevitable future for computer users. It\u8217's important that more people involve themselves in the field and that they stop producing applications which provide less security than hiding your life savings under your mattress. When you develop cryptography applications in the future you should now have a half decent idea of what is secure and what is insecure. you should be aware that your opponents are not people wearing neckties, hoping to crack your algorithm with a pencil, paper, and an iron will. Your opponents are computers; capable of thousands upon thousands of calculations per second. There\u8217's no problem with coming up with algorithms that can only be secure if they\u8217're secret. Algorithms like that can be decent fun and they\u8217're a challenge to write, just don\u8217't expect them to keep your data safe. Also, don\u8217't expect any of the low-end shareware applications to keep your texts safe, the only thing I\u8217'd trust with my files is PGP or Blowfish. But on the other hand, I don\u8217't have anything to hide.\line \line \f0\b0\i0\outl0\shad0\fs20 \cf0 \expan0 \ul0 \u160 }